export default {
  preset: 'ts-jest',
  testEnvironment: 'jsdom',
  roots: ['<rootDir>/packages/core'],
  collectCoverageFrom: ['packages/core/src/**/*.{ts,tsx}', '!packages/core/src/**/*.d.ts'],
  coverageDirectory: 'coverage',
  coverageReporters: ['text', 'lcov', 'html'],
  modulePaths: ['<rootDir>/packages/core/src'],
  testMatch: [
    '<rootDir>/packages/core/__tests__/**/*.{ts,tsx}',
    '<rootDir>/packages/core/src/**/*.{test,spec}.{ts,tsx}'
  ],
  // 配置模块名称映射，将 lodash-es 导入映射到 lodash 以解决测试环境兼容性
  moduleNameMapper: {
    '^lodash-es/(.*)$': 'lodash/$1'
  },
  moduleDirectories: ['node_modules', '<rootDir>/packages/core/src']
};
